#include "ResourceManager.h"

ResourceManager* ResourceManager::_instance = NULL;

ResourceManager::ResourceManager()
{

}

ResourceManager* ResourceManager::GetIns()
{
	if(_instance == NULL)
	{
		_instance = new ResourceManager();
	}
	return _instance;
}

void ResourceManager::Init()
{
	mario_Gun = new CTexture("Resource\\Image\\Mario_Gun.png");
	mario_Small = new CTexture("Resource\\Image\\Mario_Small.png");
	mario_Big = new CTexture("Resource\\Image\\Mario_Big.png");
	fungi = new CTexture("Resource\\Image\\Fungi.png");
	coin = new CTexture("Resource\\Image\\Coin.png");
	flower = new CTexture("Resource\\Image\\Flower.png");
	star = new CTexture("Resource\\Image\\star.png");
	turtle_alive = new CTexture("Resource\\Image\\Turtle_alive.png");
	turtle_die = new CTexture("Resource\\Image\\Turtle_die.png");
	flowerMonster = new CTexture("Resource\\Image\\FlowerMonster.png");
	brick = new CTexture("Resource\\Image\\brick.png");
	land1 = new CTexture("Resource\\Image\\103.png");
	land2 = new CTexture("Resource\\Image\\104.png");
	land3 = new CTexture("Resource\\Image\\105.png");
	pipe = new CTexture("Resource\\Image\\106.png");
	pipe2 = new CTexture("Resource\\Image\\pipe2.png");
	pipe3 = new CTexture("Resource\\Image\\pipe3.png");
	bar = new CTexture("Resource\\Image\\bar.png");
	mushroom = new CTexture("Resource\\Image\\mushroom.png");
	questionBox = new CTexture("Resource\\Image\\Question.png");
	breakbrick = new CTexture("Resource\\Image\\Brick_Break.png");
	brickPart = new CTexture("Resource\\Image\\Brick_Break_Part.png");
	bullet = new CTexture("Resource\\Image\\Bullet.png");
	cloud = new CTexture("Resource\\Image\\Cloud.png");
	fence = new CTexture("Resource\\Image\\Fence.png");
	grass = new CTexture("Resource\\Image\\Grass.png");
	moutain = new CTexture("Resource\\Image\\Moutain.png");

	mark = new CTexture("Resource\\Image\\END_MARK.png");
	collum = new CTexture("Resource\\Image\\END_COLUMN.png");
	ladder = new CTexture("Resource\\Image\\LADDER.png");
	//background
	menuBackground = new CTexture("Resource\\Image\\BackGround\\MenuBackGround.png");
	mainGameBG1 = new CTexture("Resource\\Image\\BackGround\\MainGameBG1.png");
	blackBG = new CTexture("Resource\\Image\\BackGround\\black.png");
	helpBG = new CTexture("Resource\\Image\\BackGround\\about.png");
}


CTexture* ResourceManager::GetTexture(EResource id)
{
	switch (id)
	{
	case  EResource::Mario_Gun_ID:
		return mario_Gun;
	case EResource::Mario_Big_ID:
		return mario_Big;
	case EResource::Mario_Small_ID:
		return mario_Small;
	case EResource::Fungi_ID:
		return fungi;
	case EResource::Coin_ID:
		return coin;
	case EResource::Flower_ID:
		return flower;
	case EResource::Star_ID:
		return star;
	case EResource::Turtle_alive_ID:
		return turtle_alive;
	case EResource::Turtle_die_ID:
		return turtle_die;
	case FlowerMonster_ID:
		return flowerMonster;
	case EResource::Brick_ID:
		return brick;
	case EResource::LAND1_ID:
		return land1;
	case EResource::LAND2_ID:
		return land2;
	case EResource::LAND3_ID:
		return land3;
	case EResource::PIPE_ID:
		return pipe;
	case EResource::PIPE2_ID:
		return pipe2;
	case EResource::PIPE3_ID:
		return pipe3;
	case EResource::Bar_ID:
		return bar;
	case EResource::Mushroom_ID:
		return mushroom;
	case EResource::QuestionBox_ID:
		return questionBox;
	case EResource::BrickBreak_ID:
		return breakbrick;
	case EResource::BreakBrickPart_ID:
		return brickPart;
	case EResource::Bullet_ID:
		return bullet;
	case Cloud_ID:
		return cloud;
	case Grass_ID:
		return grass;
	case Fence_ID:
		return fence;
	case Moutain_ID:
		return moutain;
	case Mark_ID:
		return mark;
	case Collum_ID:
		return collum;
	case Ladder_ID:
		return ladder;
	default:
		break;
	}
	return NULL;
}

CTexture* ResourceManager::GetBackGround(EBackGround id)
{
	switch(id)
	{
	case EBackGround::MenuBackGround:
		return menuBackground;
	case EBackGround::MainGameBG1:
		return mainGameBG1;
	case Black:
		return blackBG;
	case Help:
		return helpBG;
	}
	return NULL;
}